<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JS函数</title>
</head>
<body>
    
</body>
<script>
    // 函数构造方式1
    // function add(a,b){
    //     return a + b;
    // }

    // 函数构造方式二
    let add = function(a,b){
        return a + b;
    }
    //调用
    let sum = add(1,2);
    alert(sum);
</script>
</html>